<template>
<div>
  <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-bottom:10px">
    <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
    <el-breadcrumb-item>权限管理</el-breadcrumb-item>
    <el-breadcrumb-item>查看权限</el-breadcrumb-item>
  </el-breadcrumb>
  <el-tree :data="permissionList" :props="defaultProps" default-expand-all @node-click="handleNodeClick"></el-tree>
</div>
  
</template>


<script>
import axios from 'axios'
  export default {
    name:"permission",
    data() {
      return {
        permissionList:[],
        defaultProps: {
          children: 'sonPermissions',
          label: 'permissionName'
        }
      };
    },
    mounted(){
      this.getpermissionList();
    },
    methods: {
      handleNodeClick(data) {
        console.log(data);
      },
      getpermissionList(){
        axios.get('/rolePer/allPermission')
        .then(res => {
          this.permissionList=res.data.data;
        })
        .catch(err => {
          console.error(err); 
        })
      }
    }
  };
</script>